home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d7
/
commo50.arc
/
SAMPLES.MAC
< prev
next >
Wrap
Text File
|
1991-09-05
|
8KB
|
191 lines
┌───────────────────────────┐
│ Additional Macro Examples │
└───────────────────────────┘
This file contains a number of sample macros. Feel free to copy any of them
to COMMO.MAC and to alter them to your own needs. Additions will be made to
this file as time permits. Thanks to the users for their contributions.
{COMMO} macros can be made to do many amazing things besides just logging into
BBS's and doing mail runs (those are indeed popular functions, however). Some
of the simplest macros demonstrate this capability.
The first two macros are used for reading messages. They use the grey plus
and minus keys in the lower right corner of the keyboard. The first one sends
a <cr>, then clears the screen. Makes messages a lot easier to read since
each one starts displaying at the top of the screen. The second macro just
sends a <cr>. Nice for keyboards without the extra Enter key.
Message reading macros
───────────────────────────────────────────────────────────────────────────
{:gr+} {send |} {clear} {}
{:gr-} {send |} {}
The next macro is a very important one. It shows the basic method of asking
for a filename and uploading the file. Notice that it first sets the variable
"file" to the upload directory (the variable "uldir"). Then when the INPUt
function executes, the upload directory appears in the input line with a "\".
Upload a file using Zmodem (via DSZ)
───────────────────────────────────────────────────────────────────────────
{:af2} {setv file,%uldir\}
{input file,Enter a filename:}
{exec-AW DSZ port %_por sz -m %file} {}
Start my mail reader after a mail run
───────────────────────────────────────────────────────────────────────────
{:cF4} {exec-N slmr} {} SLMR
The next two utilities are used in various macros to wait for carrier detect
to drop, then continue dialing (ncr) and to hangup when necessary and continue
dialing (hng):
{:ncr} {:nc1} {pause 1} {ifca nc1} {pause 1} {dial ,} {beep} {}
{:hng} {pause 1} {hangup y} {pause 3} {dial ,} {beep} {}
My generic login macro will login to most popular BBS's. The generic login
subroutine can be called from mail run macros, etc. The GOLOok with the
";passwor" ignores the string "password" in the opening instructions on an
Auntie board. Put {login} in your Dialing Directory macro field.
Generic login macro
───────────────────────────────────────────────────────────────────────────
{:login} {capture y,c:\commo\commo.cap} RBBS, PCBoard, Auntie, etc.
{asci ,} {call gls} {}
Generic login subroutine
───────────────────────────────────────────────────────────────────────────
{:gls} {setlook 60,hng,10,|}
{:li1} {golo li2,(enter)} {golo li3,graphics (enter)}
{golo li4,first name} {golo li5,last name}
{golo li3,correct} {golo li1,;passwor}
{lookfor password} {send ~%_pas|} {return}
{:li2} {send ~|} {goto li1}
{:li3} {send ~y|} {goto li1}
{:li4} {send ~Fred|} {goto li1}
{:li5} {send ~Brucker|} {goto li1}
Here is a macro using variables to do a mail run on a PCBoard with a MarkMail
door or a QMail door. It will upload a reply packet if one exists, delete the
packet if the upload is successful, then log off. If there is no reply packet
it will download new messages and log off. At the end it will wait for carrier
detect to drop, then continue multi-number dialing.
The subroutines "mail_up" and "mail_dn" can be changed to use any protocol.
The supplied ones use the Internal Xmodem-1k.
Four variables must be set prior to starting this macro. These are set in the
Linked Macro specified in the Dialing Directory entry. For example, to call
Northern Lights and use the QMail door, the Linked Macro looks like this:
Northern Lights
───────────────────────────────────────────────────────────────────────────
{:northern}
{setv nodeid,nlbbs} Set node id
{setv maildoor,qmail} Set door type
{setv nomsgs,sorry, but no} Set message to LOOKfor if no messages
{setv ptim,2} Set prompt timer duration
{goto pcbmail} GOTO the mail run macro
Or here is the Linked Macro for Channel 1 using the MarkMail door:
Channel 1
───────────────────────────────────────────────────────────────────────────
{:chan1}
{setv nodeid,channel1}
{setv maildoor,markmail}
{setv nomsgs,no messages found}
{setv ptim,2}
{goto pcbmail}
PCBoard generic mailrun
───────────────────────────────────────────────────────────────────────────
{:pcbmail}
{capt y,c:\commo\%nodeid.%_day} {asci ,}
{setl 30,hng} {look ^g} {call gls}
{setl 60,hng,%ptim,n|} {look command?}
{setl 90,hng} ** turn off prompt timer
{send open %maildoor|} {look %maildoor command?}
{ifex %uldir\%nodeid.rep,,mr_dl} ** if no reply, go to download
{:mr_ul}
{send u|} {look %nodeid.rep} {call mail_up}
{look command?} {ifcon mr_gb,mr_ul} ** if error, try again
{:mr_dl}
{send d|} {push}
{golo mr_gb,%nomsgs} {golo mr_sy,when done?}
{golo mr_sy,messages (y/n)?} {look %nodeid.qwk} {pops}
{call mail_dn} {look command?} {ifcon ,mr_dl} ** if error, try again
{:mr_gb}
{send g|} {goto ncr}
{:mr_sy}
{send y|} {return}
{:mail_dn} {rxmo %dldir\%nodeid.qwk} {comp %_err,0} {return}
{:mail_up} {sxmo-k %uldir\%nodeid.rep} {ifer 1,mu_end}
{exec-N del %uldir\%nodeid.rep}
{:mu_end} {comp %_err,0} {return}
This is my mail run macro for Directory Assistance using the JIMMER mail door.
If a reply packet exists, it will be uploaded. If there is no reply packet it
will download the new messages.
Directory Assistance mail run
───────────────────────────────────────────────────────────────────────────
{:damail}
{unmark 3dir 2dir} {setv nodeid,dirasnt}
{capt y,\commo\dir.%_day} {asci ,}
{setl 60,off}
{golo ncr,no carrier}
{look =-=-=-=-=-}
{setl 60,off,3,n|}
{look first name} {send fred;brucker;%_pass%;!main|}
{golo ncr,no carrier}
{look your command} {send open jimmer|}
{setl 60,off}
{call dm3}
{ifex %uldir\%nodeid.rep,,dm1}
{:dm0} {send u|} {look %nodeid.rep} {call mail_up}
{call dm3} {ifcon ,dm0} {send g|} {goto dm2}
{:dm1} {send d|}
{golo off,no messages to download}
{golo off,you must select}
{setl 300,off}
{look %nodeid.qwk} {call mail_dn} {call dm3} {ifcon ,dm1}
{:dm2} {send g|} {look slam!} {goto off}
{:dm3} {push}
{golo dm4,to continue>}
{golo dm5,no carrier}
{look your selection} {pops} {return}
{:dm4} {send |} {return}
{:dm5} {pops} {goto ncr}
Here's my latest whizbang quoting macro. It saves the Screen Image File
pathname in the variable "scrsav."
Then it sets the Screen Image File to a temporary file and goes into
Scrollback. In Scrollback I write a block of text to disk (the quote), then
exit. My editor (QEdit) is then executed on the temporary file. I do what I
need there to dress up the quote (like add quoting marks, etc.). When I save
the file and exit the editor, the macro does an ASCII Upload of the file and
deletes it.
Then the Screen Image pathname is restored to what it was before.
Quoting macro
───────────────────────────────────────────────────────────────────────────
{:cf6} {setv scrsav,%_scr} {screen n,%dldir\temp} {scroll}
{exec-N q %_scr} {asci %_scr}
{exec-N del %_scr} {screen n,%scrsav} {}